package com.bfsoft.springbootinit.controller;


import com.bfsoft.springbootinit.pojo.dto.IdDTO;
import com.bfsoft.springbootinit.pojo.dto.function.PermissionDTO;
import com.bfsoft.springbootinit.pojo.vo.ResultVO;
import com.bfsoft.springbootinit.pojo.vo.function.FunctionCheckedVO;
import com.bfsoft.springbootinit.service.ISysFunctionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * (功能表)SYS_FUNCTION 前端控制器
 * </p>
 *
 * @author xxx
 * @since 2024-10-18
 */
@RestController
@RequestMapping ( "/sys-function" )
@Tag ( name = "权限管理", description = "权限管理" )
public class SysFunctionController {

	@Resource
	private ISysFunctionService functionService;

	@PostMapping ( "/getListByRole" )
	@Operation ( summary  = "角色权限", description = "角色权限" )
	public ResultVO < FunctionCheckedVO > getListByRole ( @RequestBody IdDTO dto ) {
		return functionService.getListByRole ( dto );
	}

	@PostMapping ( "/setPermission" )
	@Operation ( summary  = "权限设置", description = "权限设置" )
	public ResultVO < Object > setPermission ( @RequestBody PermissionDTO dto ) {
		return functionService.setPermission ( dto );
	}

}
